package com.chanyachting.emall.domain;

import java.lang.reflect.InvocationTargetException;
import java.util.List;

import org.apache.commons.beanutils.BeanUtils;

import com.chanyachting.emall.dao.BusinesstypeDAO;
import com.chanyachting.emall.domain.base.BaseBusinesstype;

/**
 * This is the object class that relates to the businesstype table.
 * Any customizations belong here.
 */
public class Businesstype extends BaseBusinesstype {

/*[CONSTRUCTOR MARKER BEGIN]*/
	public Businesstype () {
		super();
	}

	/**
	 * Constructor for primary key
	 */
	public Businesstype (java.lang.Integer _id) {
		super(_id);
		
		Businesstype btype=(Businesstype)new BusinesstypeDAO().load(Businesstype.class, _id);
		
		if(btype!=null){
			
			try {
				BeanUtils.copyProperties(this, btype);
			} catch (IllegalAccessException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			} catch (InvocationTargetException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
		}
	}

	/**
	 * Constructor for required fields
	 */
	public Businesstype (
		java.lang.Integer _id,
		java.lang.Integer _pri,
		java.lang.String _name) {

		super (
			_id,
			_pri,
			_name);
	}

/*[CONSTRUCTOR MARKER END]*/
	
	
	public static List list(){

		return new BusinesstypeDAO().find("from Businesstype");
	}
	
}